<?php

class Commission extends AppModel {
	var $name = 'Commission';

	var $useTable = 'mnhis_commission';

	protected $fields = array(
		'id' => array('name' => 'ID'),
		'fk_transfer_id' => array('name' => 'Obrat', 'reference' => array('model' => 'Transfer', 'field' => 'id', 'default' => 'Žiadny')),
		'fk_person_id' => array('name' => 'Osoba', 'reference' => array('model' => 'Person', 'field' => 'full_name', 'default' => 'Nikto')),
		'fk_person_type_id' => array('name' => 'Typ osoby', 'reference' => array('model' => 'PersonType', 'field' => 'title', 'default' => 'Žiadny')),
		'percentage' => array('name' => '%'),
		'value' => array('name' => 'Hodnota'),
		'type' => array('name' => 'Typ', 'evaluation' => array('1' => 'provízia pre makléra', '2' => 'provízia z ponuky', '3' => 'provízia z dopytu', 'default' => 'neznámy')),
	);
	
	var $belongsTo = array(
		'Transfer' => array(
			'className' => 'Transfer',
			'foreignKey' => 'fk_transfer_id',
		),
		'Person' => array(
			'className' => 'Person',
			'foreignKey' => 'fk_person_id',
		),
		'PersonType' => array(
			'className' => 'PersonType',
			'foreignKey' => 'fk_person_type_id',
		)
	);
}

?>